package com.wetao.testkotlin

class TestField(val name: String){
    var address: String = "unknown"
        set(value: String) {
            println("address = $address ---- value = $value")
            field = value
        }
        get() {
            println("TestField get")
            return field
        }
}

class TestLenthCounter{
    //类外无法设置
    var counter:Int = 0
        private set
    fun addWord(word:String){
        counter += word.length
    }
}